﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestSqlite
{
    
    [TestClass()]
    public class InitDatabase
    {
        public static bool hasInitial = false;

        static InitDatabase()
        {
            Init();
            hasInitial = true;
        }

        [TestInitialize]
        public static void Init()
        {
            string backupPath = Directory.GetCurrentDirectory()+@"\backup.db";
            string databasePath = Directory.GetCurrentDirectory() + @"\test.db";
            try
            {
                File.Delete(databasePath);
                File.Copy(backupPath, databasePath);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            
        }
    }
}
